package com.hive

import org.apache.spark.sql.SparkSession


object HiveRead {
  def main(args: Array[String]): Unit = {
    val spark: SparkSession = SparkSession
      .builder()
      .master("local[*]")
      .appName("HiveRead")
      // 添加支持外置hive
      .enableHiveSupport()
      .getOrCreate()

    //    spark.sql("show databases").show
    spark.sql("use gmall").show
    //    spark.sql("show tables").show
    spark.sql("select * from emp").show
    spark.close()
  }
}
